{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d8f47719-21e9-4a99-bb44-73c4f8b99c3d",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import datacompy\n",
    "from buckaroo import BuckarooWidget\n",
    "from datacompy_app import DatacompyBuckaroo"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9e139222-b8f1-4293-9259-651d708da3fd",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Create sample DataFrames\n",
    "df_a = pd.DataFrame({\n",
    "    'a': [2, 3, 4, 5, 6, 7, 8],\n",
    "    'b': [5, 4, 9, 4, 6, 7, 8],\n",
    "    'c': [ 'foo', 'bar', None, None, 'bar', 'bar', 'foo']})\n",
    "\n",
    "df_b = pd.DataFrame({\n",
    "    'a': [2, 3, 4, 5, 6, 7, 8],\n",
    "    'b': [ 5, 4, 4, 4, 6, 4, 4],\n",
    "    'd': ['baz', 'baz', 'bar', None, None, 'bar', 'bar'],\n",
    "    'f': [10, 1, 200, 150, 140, 130, 120]\n",
    "})  # Notice the difference in the last row\n",
    "\n",
    "# a doesn't line up \n",
    "df_c = pd.DataFrame({\n",
    "    'a': [3, 4, 5, 6, 7, 8, 9],\n",
    "    'b': [4, 9, 7, 4, 4, 6, 4],\n",
    "    'd': ['foo', 'baz', 'baz', None, None, 'bar', 'bar'],\n",
    "})  # Notice the difference in the last row\n",
    "DatacompyBuckaroo(df_a, df_c, join_columns=['a'], how='outer')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "95b72a45-c881-4dae-99bd-a3c55a156d5d",
   "metadata": {},
   "outputs": [],
   "source": [
    "# a doesn't line up \n",
    "df_d = pd.DataFrame({\n",
    "    'a': [3, 4, 5, 6, 7, 8, 9],\n",
    "    'b': [4, 9, 7, 4, 4, 6, 4],\n",
    "    'c': [4, 9, 7, 4, 4, 6, 4],\n",
    "})\n",
    "# a doesn't line up \n",
    "df_e = pd.DataFrame({\n",
    "    'a': [3, 4,     5, 60, 70, 80, 90],\n",
    "    'b': [4, 9, 7,  4, 4, 6, 4],\n",
    "    'c': [4.0, 9.1, None, 4, 4, 6, 4]\n",
    "})\n",
    "DatacompyBuckaroo(df_d, df_e, join_columns=['a'], how='outer')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.8"
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {},
    "version_major": 2,
    "version_minor": 0
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
